package com.ai.notices.web.system.util;

import javax.servlet.http.HttpSession;

import com.ai.notices.dao.mysql.model.AuthStaff;

public final class StaffSessionUtil {

	//行为分析登录信息session 名
	private static final String staffSessionName = "staffSession";
	//菜单权限
	private static final String staffSessionAuthMenu = "staffSessionAuthMenu";
	
	/**
	 * 设置登陆Session信息
	 * @param session
	 * @param staff
	 */
	public static void setStaffInfo(HttpSession session,AuthStaff staff){
		session.setAttribute(staffSessionName, staff);
	}
	
	/**
	 * 获取登陆信息
	 * @param session
	 * @return
	 */
	public static AuthStaff getStaffInfo(HttpSession session){
		Object u = session.getAttribute(staffSessionName);
		if(u != null){
			return (AuthStaff)u;
		}else{
			return null;
		}
	}
		
	/**
	 * 移除登录Session信息
	 * @param session
	 */
	public static void removeStaffInfo(HttpSession session){
		session.removeAttribute(staffSessionName);
	}
	//public static void setStaffMenu(HttpSession session,List<StaffMenuRespDTO> list){
	//	session.setAttribute(staffSessionAuthMenu, list);
	//}
	
}
